import Vue from 'vue'
// import VueResource from 'vue-resource'
import App from './App'
import store from './store'  // vuex通用值
import router from './router/index.js'
import axios from 'axios'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
import './common/stylus/index.styl'
import './assets/styles/iconfont.css'
import 'vue2-toast/lib/toast.css'
import Toast from 'vue2-toast'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueLazyload from 'vue-lazyload'
import VueAMap from 'vue-amap'
Vue.use(VueAMap)

Vue.config.productionTip = false
VueAMap.initAMapApiLoader({
  key: 'dc88aa1487e11f1d40e516e7cdeb267b',
  plugin: [
    'AMap.Autocomplete',
    'AMap.PlaceSearch', // POI搜索插件
    'AMap.Scale', // 右下角缩略图插件 比例尺
    'AMap.OverView', // 地图鹰眼插件
    'AMap.ToolBar', // 地图工具条
    'AMap.MapType', // 类别切换控件，实现默认图层与卫星图、实施交通图层之间切换的控制
    'AMap.PolyEditor', // 编辑 折线多，边形
    'AMap.CircleEditor', // 圆形编辑器插件
    'AMap.Geocoder'// 定位控件，用来获取和展示用户主机所在的经纬度位置
  ],
  uiVersion: '1.0'
})

// Vue.use(VueResource)
Vue.use(ElementUI)
Vue.config.devtools = true
Vue.config.productionTip = false
Vue.use(VueAwesomeSwiper)
Vue.use(Toast, {
  type: 'center',
  duration: 3000,
  wordWrap: true,
  width: '150px'
})
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1542437322298&di=b66a9746c26ab9e46d47b4190624a779&imgtype=0&src=http%3A%2F%2Fs15.sinaimg.cn%2Fmiddle%2F489c6ece9762ffd51ebce%26690',
  loading: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1542436601261&di=608bd098d12030ace271a105d99e9762&imgtype=0&src=http%3A%2F%2Fs7.sinaimg.cn%2Fmiddle%2F0d80b434n92f50290d8c6%26690',
  attempt: 1
})
Vue.prototype.$http = axios

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
